<!--Javascript-->
<script type="text/javascript" src="<?php echo base_url().'assets/js/jquery.min.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'assets/lib/fancybox/jquery.fancybox.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'assets/js/bootstrap.min.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'assets/js/bootstrap-datepicker.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'assets/themes/pinoytuner/js/jquery.scrollTo.min.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'assets/themes/pinoytuner/js/jquery.localScroll.min.js';?>"></script>
<!--FONT-->
<script type="text/javascript">
   document.write('\x3Cscript src="' + (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//webfonts.creativecloud.com/economica:n4:all;cuprum:n4:all;bebas-neue:n4:all.js" type="text/javascript">\x3C/script>');
</script>



<!-- datatables -->
<script type="text/javascript" src="<?php echo base_url(); ?>assets/lib/datatables/js/jquery.dataTables.min.js"></script>

<!-- chosen -->
<script type="text/javascript" src="<?php echo base_url(); ?>assets/lib/chosen/chosen.jquery.min.js"></script>
<!---------------Scroll To------------>
<script type="text/javascript" src="<?php echo $js_dir; ?>jquery.scrollto.min.js"></script>
<!---------scroll spy---------------------->
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/bootstrap.scrollspy.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/lib/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/lib/bootstrap-modal/js/bootstrap-modal.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/lib/tinymce/js/tinymce/jquery.tinymce.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/authentication.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/big-modal.js"></script>
<script type="text/javascript">	
	var loader = "<img src='<?php echo base_url() ?>assets/img/ajax-loader.gif' >";
	var base_url = "<?php echo base_url() ?>";
	
	$(document).ready(function(){
			scrollToContainer($('#home-trigger'));
		$('.scroll-to').click(function(e){			
			e.preventDefault();
			var object = $(this);			
			scrollToContainer(object);
		});
	 
        <?php if($res == 1): ?>
            $('#thank-you').modal('show');
            $('.close-thankyou').click(function(){
                $('#thank-you').modal('hide');
                document.location="<?php echo base_url(); ?>";
            });
        <?php endif; ?>
        $('.close-reserve').click(function(){
                $('#emailModal').modal('hide');
            });
        $("#email-reserve").submit(function(e){
            var name = $("#name").val();
            var email = $("#email").val();
            var contact = $("#contact").val();
            if(name == "" || email == "" || contact == ""){
                e.preventDefault();
                alert("Please fill in required fields");
            }
            else
                return true;
        
        });
        
        $('.community-tooltip').tooltip();
			$("#signin").click(function(e){
				$("#login-form").validate();
				e.preventDefault;
				if($("#login-form").valid())
					login($("#strEmail").val(), $("#strPass").val()); 
			});
			$(".textinput").keydown(function(e)
			{
				if(e.keyCode=="13")
				{
					if($("#login-form").valid())
					login($("#strEmail").val(), $("#strPass").val()); 
				}
			});
			$("#forgot-btn").click(function(){
				$("#login-modal").fadeOut("fast");
			});
		      
            $("#trigger").hover(function(){ $("#sub-navigation").slideDown('fast'); },function(){$("#sub-navigation").hide();});
			$("#forgot-password").click(function(){
				$("#forgot-password-form").validate();
					if($("#forgot-password-form").valid()){
						$("#forgot-password").hide();
						show_loading_gif("#forgot-password-form .button-set");
						forgot_password($("#email-forgot-address").val());
					}else{
						$("#email-forgot-address").val('');
					}
			});
		});
		
        
    
        
    
		function show_loading_gif(target) {
			$('.ajax-loader-small').remove();
			$(target).append('<img class="ajax-loader-small" src="' + base_url + 'images/ajax_loader_small.gif" />');
			setTimeout('hide_loading_gif()', '5000');
		}
		
		function hide_loading_gif() {
			$('.ajax-loader-small').fadeOut('slow').remove();
		}
		
		function forgot_password(_email)
		{
			var success = 0;
			$.post(base_url + "users/forgot/", {
				email: _email
			}, function(response){
				if(response){
					var modal_message = "An email with the reset link has been sent to your email address.";
                    hide_loading_gif();
					var success = 1;
				}else{
					var modal_message = "That email address does not exist on our databases";
                    hide_loading_gif();
				}
				$("#forgot-error").empty().append(modal_message).fadeIn('fast');
				setTimeout('$("#forgot-error").fadeOut("fast")', 2000);
				if(success)
					document.location = base_url+'login';
				
			});
		}
		
		function login(_email, _password)
		{
			$.post("<?php echo base_url(); ?>users/auth/", {
				strEmail: _email,
				strPass: _password
			}, function(response){
				loginUser(response);
			});
			
			return false;
		}
		function scrollToContainer(object)
	{			
			//object.parent().parent().children('li').removeClass('active');			
			var go = object.attr('href');
			
			if(go == "#home")
			{			
				scrollToTop();				
			}
			else
			{
				$(go).ScrollTo({offset:{top:50}});
			}
						
			//object.parent().addClass("active");
		
	}
	
	function scrollToTop()
	{
		$('body,html').animate({
		scrollTop: 0
		}, 800);
	}     
	
</script>
<script type="text/javascript">
$(document).ready(function() {
   $('#navlist > li').localScroll({duration:800});
   $(".collapse").collapse()
});
</script>
<!-------google analytics---------------------->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18317479-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

		
	
	